package com.gee.spring.cloud.data.transform.mgt.controller;

import cn.hutool.core.util.HexUtil;
import com.gee.spring.cloud.common.core.api.result.ApiResult;
import com.gee.spring.cloud.common.starter.socket.SocketHolder;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gepengjun
 * @since 2024/6/21 9:23
 */
@Api(tags = "socket接口")
@RestController
@RequestMapping("/socket")
public class SocketController {


    @GetMapping("/sendMsg")
    public ApiResult<Object> sendMsg(Long socketId, Long channelId){
        byte[] bytes = HexUtil.decodeHex("10F11401005121000111290401210116A51A000000000000EA224E2396160700E21B961600FFCC");

        SocketHolder.writeAndFlush(socketId , channelId, bytes);
        return ApiResult.success();
    }
}
